using System.Data;
using ET;

namespace DA
{
	public class Job_DAL
	{
	private clsConnect cls = new clsConnect();

	#region Getdata
	public DataTable BindGirdtb_Job(string keywords)
	{
	return cls.Search("sp_tb_Job_Search", "@KeyWords", keywords);
	}
    //public DataTable BindGirdtb_JobDetail(int id)
    //{
    //}
	#endregion

	#region Insert
	public bool Inserttb_Job(Job_ET data)
	{
	cls.CreateNewSqlCommand();
	cls.AddParameter("@Job_Name", data.Job_Name);
	cls.AddParameter("@Job_Note", data.Job_Note);
	cls.AddParameter("@Job_User_Add", data.Job_User_Add);
	cls.AddParameter("@Job_Date_Add", data.Job_Date_Add);
	cls.AddParameter("@Job_Computer_Add", data.Job_Computer_Add);
	cls.AddParameter("@Job_User_Modify", data.Job_User_Modify);
	cls.AddParameter("@Job_Date_Modify", data.Job_Date_Modify);
	cls.AddParameter("@Job_Computer_Modify", data.Job_Computer_Modify);
	cls.ExecuteNonQuery("sp_tb_Job_Insert");
	return true;
	}
	#endregion

	#region Update
	public bool Updatetb_Job(Job_ET data)
	{
	cls.CreateNewSqlCommand();
	cls.AddParameter("@Job_ID", data.Job_ID);
	cls.AddParameter("@Job_Name", data.Job_Name);
	cls.AddParameter("@Job_Note", data.Job_Note);
	cls.AddParameter("@Job_User_Add", data.Job_User_Add);
	cls.AddParameter("@Job_Date_Add", data.Job_Date_Add);
	cls.AddParameter("@Job_Computer_Add", data.Job_Computer_Add);
	cls.AddParameter("@Job_User_Modify", data.Job_User_Modify);
	cls.AddParameter("@Job_Date_Modify", data.Job_Date_Modify);
	cls.AddParameter("@Job_Computer_Modify", data.Job_Computer_Modify);
	cls.ExecuteNonQuery("sp_tb_Job_Update");
	return true;
	}
	#endregion

	#region Delete
	public bool Deletetb_Job(int id)
	{
        cls.Delete("sp_tb_Job_Delete", "@Job_Id", id);
        return true;
	}
	#endregion
	}
}